package com.cskaoyan.bean;

import lombok.Data;

/**
 * @author stone
 * @date 2022/12/23 11:36
 */
@Data
public class BaseRespVo<T>{
    T data;
    String msg;
    int status;

    // 可以在vo中增加一些静态方法，方便我们完成一些封装
    public static BaseRespVo ok() {
        BaseRespVo baseRespVo = new BaseRespVo();
        baseRespVo.setMsg("成功");
        baseRespVo.setStatus(200);
        return baseRespVo;
    }
    public static <T> BaseRespVo ok(T data) {
        BaseRespVo<T> baseRespVo = new BaseRespVo();
        baseRespVo.setData(data);
        baseRespVo.setMsg("成功");
        baseRespVo.setStatus(200);
        return baseRespVo;
    }
}
